import 'package:xixi/global.dart';
import 'package:flutter/material.dart';
import 'package:xixi/page/about.dart';
import 'package:xixi/page/favorite.dart';

class SettingCard extends StatefulWidget {
  SettingCard({Key key}) : super(key: key);
  @override
  _SettingCardState createState() => _SettingCardState();
}

class _SettingCardState extends State<SettingCard> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Container(
      margin: EdgeInsets.all(15),
      padding: EdgeInsets.all(10),
      height: 200,
      decoration: BoxDecoration(
        borderRadius: BorderRadius.circular(20),
        color: Global.backgroundColor.withOpacity(0.9),
        boxShadow: [
          BoxShadow(
            color: Colors.black.withOpacity(0.2),
            offset: Offset(0, 5),
            blurRadius: 10,
            spreadRadius: 6,
          )
        ],
      ),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceAround,
        crossAxisAlignment: CrossAxisAlignment.center,
        children: [
          InkWell(
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(
                  builder: (context) => FavoritePage(),
                ),
              );
            },
            child: Container(
              width: 120,
              height: 165,
              decoration: BoxDecoration(
                borderRadius: BorderRadius.circular(15),
                gradient: LinearGradient(
                  begin: Alignment.topLeft,
                  end: Alignment.bottomRight,
                  colors: [
                    Color(0xFFFF97B7),
                    Color(0xFFC42636),
                  ],
                ),
              ),
              child: Column(
                mainAxisAlignment: MainAxisAlignment.center,
                crossAxisAlignment: CrossAxisAlignment.center,
                children: [
                  Container(
                    width: 70,
                    height: 70,
                    child: Image.asset('assets/images/like.png'),
                  ),
                  SizedBox(height: 10),
                  Text(
                    '收藏',
                    style: TextStyle(
                      color: Global.backgroundColor.withOpacity(0.7),
                      fontWeight: FontWeight.w800,
                      fontSize: 23,
                    ),
                  )
                ],
              ),
            ),
          ),
          InkWell(
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(
                  builder: (context) => AboutPage(),
                ),
              );
            },
            child: Container(
              width: 120,
              height: 165,
              decoration: BoxDecoration(
                borderRadius: BorderRadius.circular(15),
                gradient: LinearGradient(
                  begin: Alignment.topLeft,
                  end: Alignment.bottomRight,
                  colors: [
                    Color(0xFFFFF188),
                    Color(0xFFE45615),
                  ],
                ),
              ),
              child: Column(
                mainAxisAlignment: MainAxisAlignment.center,
                crossAxisAlignment: CrossAxisAlignment.center,
                children: [
                  Container(
                    width: 70,
                    height: 70,
                    child: Image.asset('assets/images/about.png'),
                  ),
                  SizedBox(height: 10),
                  Text(
                    '注意事项',
                    style: TextStyle(
                      color: Global.backgroundColor.withOpacity(0.7),
                      fontWeight: FontWeight.w800,
                      fontSize: 23,
                    ),
                  )
                ],
              ),
            ),
          ),
        ],
      ),
    );
  }
}
